<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="entityBeans.ContactGroup" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" media="screen, projection" href="scripts/demo.css" />
<script type="text/javascript" src="scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="scripts/jconfirmaction.jquery.js"></script>
<script type="text/javascript">
			$(document).ready(function() {
				$('.ask').jConfirmAction();
			});
			
</script>
<title>Registered groups</title>
</head>
<body>
	<%@include file="header.jsp" %>
	<% List<String> groups = (List<String>)request.getAttribute("listGroup");
	if (groups != null && groups.size() > 0){ %>
	
	<table id="container" border="1">
	<thead>
		<tr><th>Group Name</th><th>Actions</th></tr>   
	</thead>
	<tr><td><a href=<%="\"SearchContacts?nameGroup=Friend"+"\""%>>Friend</a></td><td></td></tr>
	<tr><td><a href=<%="\"SearchContacts?nameGroup=Family"+"\""%>>Family</a></td><td></td></tr>
	<tr><td><a href=<%="\"SearchContacts?nameGroup=Colleague"+"\""%>>Colleague</a></td><td></td></tr>
	<%for(String g : groups){
		if(!g.equals("Friend") && !g.equals("Family") && !g.equals("Colleague")){%>
	<tr>
	<td><a href=<%="\"SearchContacts?nameGroup="+g+"\""%>><%=g%></a></td>
	<td><a href=<%="\"DeleteGroup?nameGroup="+g+"\""%> class="ask"><img src="img/delete.png" alt="delete group"/></a></td>
	</tr>		
	<%}}%>
	</table>
	<%}else {%>
	<i>No group to display !! </i>
	<%}%>
</body>
</html>